﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; 
using System.Linq;
using System.Web;

namespace Keepo.Models.Services
{
    public class DesignImageExport
    {
        public DesignImageExport() { }

        public DesignImageExport( DesignImage image) 
        {
            DesignImageId = image.DesignImageId;
            ExternalImageId = image.ExternalId != null ? image.ExternalId.ToString() : "";
            Title = image.Title;

            URL = image.URL;
            LowResUrl = image.LowResUrl;
            ThumbnailURL = image.ThumbnailUrl;

            ImageWidth = image.ImageWidth;
            ImageHeight = image.ImageHeight;

            ImageCategoryId = image.ImageCategoryId;

            IsRepeat = (image.IsRepeat != null) ? image.IsRepeat.Value : false;
        }

        public long DesignImageId { get; set; }
        public string ExternalImageId { get; set; }
        public string Title { get; set; }
        public string URL { get; set; }
        public string LowResUrl { get; set; }
        public string ThumbnailURL { get; set; }
        public int? ImageCategoryId { get; set; }
        public int ImageWidth { get; set; }
        public int ImageHeight { get; set; }
        public bool IsSingle { get; set; }
        public bool IsRepeat { get; set; }

        public DesignImage toEntity()
        {
            DesignImage image = new DesignImage();

            image.ImageCategoryId = this.ImageCategoryId;
            image.Title = this.Title;
            image.URL = this.URL;
            image.ThumbnailUrl = this.ThumbnailURL;

            return image;
        }
    }

   
}